package com.itheima.pinda.controller;

import com.itheima.pinda.common.utils.BaiduMapUtils;
import lombok.extern.log4j.Log4j2;
import org.springframework.web.bind.annotation.*;

@Log4j2
@RestController
@CrossOrigin
@RequestMapping("/map")
public class BaiduMapController {
    /**
     * 通过区县名称查询经纬度
     * @param countryName
     * @return
     */
    @GetMapping("/queryLocationByCountry")
    public String queryLocationByCountry(@RequestParam String countryName){
        String coordinate = BaiduMapUtils.getCoordinate(countryName);
        return coordinate;
    }
}
